/* Prints a table of square using a for statement */
#include <stdio.h>
int main(void)
{
    printf("This program prints a table of squares.\n");
    //for (short i = 1; i > 0 && i * i > 0; i++) {
    for (short i = 1; i > 0 && (short)(i * i) > 0; i++) {  // 这个循环终止条件用了强制类型转换，否则是int
        printf("%10hd%20d\n", i, i * i);  // 这里 i * i 会自动提升为int类型
        if (i % 24 == 0) {
            printf("Press Enter to continue...");
            while (getchar() != '\n')
                /* 直到读取到回车为止 */;
        }
    }
    return 0;
}